package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.manager.service.SysMenuRoleService;
import com.atguigu.spzx.model.dto.system.AssginMenuDto;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: SysMenuRoleController
 * @Package: com.atguigu.spzx.manager.controller
 * @Description 保存角色分配菜单
 * @Author 孤妤
 * @Date: 2023/12/6 16:24
 */
@Tag(name = "角色分配菜单")
@RestController
@RequestMapping("/admin/system/sysMenuRole")
public class SysMenuRoleController {
    @Autowired
    private SysMenuRoleService sysMenuRoleService;
    @PostMapping("/addSysMenuRole")
    @Operation(summary = "保存角色选择的菜单")
    public Result addSysMenuRole(@RequestBody AssginMenuDto assginMenuDto){
        sysMenuRoleService.addSysMenuRole(assginMenuDto);
        return Result.build(null, ResultCodeEnum.SUCCESS).setMsg("分配菜单成功");
    }
}
